package com.eryos.android.cigarettecounter.database;


/**
 * Project :  CigaretteCounter
 * Author :   Olivier Combe 
 * URL :      http://eryos.fr/CigaretteCounter/
 *
 * Copyright (C) 2012 - Olivier Combe 
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 *
 */

public class DBFields {
	
	public static final String THIS_DAY = "strftime('"+DBTools.DATE_FORMAT+"', "+DBTools.getNow()+")";
	public static final String THIS_WEEK = "strftime('"+DBTools.WEEK_FORMAT+"', "+DBTools.getNow()+")";
	public static final String PREVIOUS_WEEK = "strftime('"+DBTools.WEEK_FORMAT+"', "+DBTools.getNow()+", '-7 days')";
	public static final String THIS_MONTH = "strftime('"+DBTools.MONTH_FORMAT+"', "+DBTools.getNow()+")";
	public static final String PREVIOUS_MONTH = "strftime('"+DBTools.MONTH_FORMAT+"', "+DBTools.getNow()+", '-1 months')";
	
	public static final String SIX_WEEKS_AGO = "strftime('%Y-%W', "+DBTools.getNow()+", '-"+(DBTools.NUMBER_OF_HISTORY*7)+" days')";
	public static final String SIX_MONTHS_AGO = "strftime('%Y-%m', "+DBTools.getNow()+", '-"+DBTools.NUMBER_OF_HISTORY+" months')";

	public static final String DB_WEEK = "strftime('"+DBTools.WEEK_FORMAT+"', "+DBConnector.TIME_COLUMN+")";

	public static final String COUNT = "count(1) Nb";
	public static final String FILTER_THIS_WHEEK = DB_WEEK+" = "+THIS_WEEK;

	
	public static final String DATE = "strftime('"+DBTools.DATE_FORMAT+"', "+DBConnector.TIME_COLUMN+")";
}


